package edu.towson.cosc.cosc455.dspenc5.compiler;

import java.util.ArrayList;

public class LexicalTokens {
	
	//lolcode start/end
	final static String DOC_BEGIN = "#HAI";
	final static String DOC_END = "#KTHXBYE";
	
	//head start/end
	final static String HEAD_BEGIN = "#MAEK HEAD";
	final static String HEAD_END = "#OIC";
	
	//bold start/end
	final static String BOLD_BEGIN = "#GIMMEH BOLD";
	final static String BOLD_END = "#MKAY";
	
	//italics start/end
	final static String ITALICS_BEGIN = "#GIMMEH ITALICS";
	final static String ITALICS_END = "#MKAY";
	
	//title start/end
	final static String TITLE_BEGIN = "#GIMMEH TITLE";
	final static String TITLE_END = "#MKAY";
	
	//paragraph start/end
	final static String PARAGRAPH_BEGIN = "#MAEK PARAGRAF";
	final static String PARAGRAPH_END = "#OIC";
	
	//list start/end
	final static String LIST_BEGIN = "#MAEK LIST";
	final static String LIST_END = "#OIC";
	
	//item start/end
	final static String ITEM_START = "#GIMMEH ITEM";
	final static String ITEM_END = "#MKAY";
	
	//comment start/end
	final static String COMMENT_BEGIN = "#OBTW";
	final static String COMMENT_END = "#TLDR";
	
	//define variable start/middle/end
	final static String VARIABLE_BEGIN = "#I HAS A";
	final static String VARIABLE_MIDDLE = "#ITZ";
	final static String VARIABLE_END = "#MKAY";
	
	//use variable start/end
	final static String VARIABLE_USE_BEGIN = "#VISIBLE";
	final static String VARIABLE_USE_END = "#MKAY";
	
	//audio start/end
	final static String AUDIO_BEGIN = "#GIMMEH SOUNDZ";
	final static String AUDIO_END = "#MKAY";
	
	//video start/end
	final static String VIDEO_BEGIN = "#GIMMEH VIDZ";
	final static String VIDEO_END = "#MKAY";
		
	//newline
	final static String NEWLINE = "#GIMMEH NEWLINE";
	
	
	/**
	 * Method determines if the given string is a possible token.
	 * @param s = token to be looked up
	 * @return true if it is a possible token, otherwise returns false
	 */
	
	public static boolean isPossibleToken(String s) {
		ArrayList<String> possibleTokens = new ArrayList<String>();//stores all possible tokens
		possibleTokens.add(AUDIO_BEGIN);
		possibleTokens.add(AUDIO_END);
		possibleTokens.add(BOLD_BEGIN);
		possibleTokens.add(BOLD_END);
		possibleTokens.add(COMMENT_BEGIN);
		possibleTokens.add(COMMENT_END);
		possibleTokens.add(DOC_BEGIN);
		possibleTokens.add(DOC_END);
		possibleTokens.add(HEAD_BEGIN);
		possibleTokens.add(HEAD_END);
		possibleTokens.add(ITALICS_BEGIN);
		possibleTokens.add(ITALICS_END);
		possibleTokens.add(LIST_BEGIN);
		possibleTokens.add(LIST_END);
		possibleTokens.add(NEWLINE);
		possibleTokens.add(PARAGRAPH_BEGIN);
		possibleTokens.add(PARAGRAPH_END);
		possibleTokens.add(TITLE_BEGIN);
		possibleTokens.add(TITLE_END);
		possibleTokens.add(VARIABLE_BEGIN);
		possibleTokens.add(VARIABLE_END);
		possibleTokens.add(VARIABLE_MIDDLE);
		possibleTokens.add(VARIABLE_USE_BEGIN);
		possibleTokens.add(VARIABLE_USE_END);
		possibleTokens.add(VIDEO_BEGIN);
		possibleTokens.add(VIDEO_END);
		possibleTokens.add(ITEM_START);
		possibleTokens.add(ITEM_END);
		
		//returns true if found token is a possible token
		return possibleTokens.contains(s.toUpperCase());
	}

}
